home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / sm32a.zip / SYMBMATH.H07 < prev    next >
Text File  |  1994-03-29  |  1KB  |  21 lines

  1.           3.1.5.6  Procedures
  2.     A procedure is similar to a function, but the right side of
  3. assigment in its definition is multi statements grouped by block().
  4. The block(a,b,c) groups a,b,c and only returns the last arguement as its
  5. value, or returns the second last arguement as its value if the last
  6. arguement is local(). It is used as grouper in definition of a procedure.
  7. All variables in block are global, except for variables declared by
  8. local().
  9.         e.g. f(x_):=block(p:=x^6,p,local(p))
  10.         Remember that you can split a line of program into multi-lines
  11. program at comma ,.
  12.  
  13.           3.1.5.7  Rules
  14.     A rule is similar to a function. In definition of function, all 
  15. arguements of function are simple variables, but in definition of rules,
  16. the first arguement may be a complicated expression.
  17.     e.g.
  18.     f(x_,y_) := x^2+y^2                     # defining function
  19.     f(x_,y_) := block(a:=2, a+x^2+y)        # defining procedure
  20.     log(x_ * y_) := log(x)+log(y)           # defining rule
  21.